package com.zjl.spring.thread;

import java.util.concurrent.TimeUnit;

/**
 * @Auther: zhuangjl
 * @Date: 2021/11/10 15:41
 */
public class ThreadDeamonDemo {


    public static void main(String[] args) {
        Thread thread = new Thread(() -> {
            while (true) {

            }
        });
        thread.setDaemon(true);
        thread.start();
        try {
            TimeUnit.MILLISECONDS.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
}
